#include <TFile.h>
#include <TTree.h>
#include <iostream>
using namespace std;
void CheckRootFile()
{
    TFile *file = new TFile("/media/wlf/Data_6_T/wlf/HIRIBL-TOF/HIRFTOF/RootData/Pair_Run_DAS2_data1_20250714T222403_0.root", "read");
    TTree *treePair = new TTree();
    file->GetObject("treePair", treePair);
    long long tsSlc, tmStp[10000], coarse[10000];
    short brd, ch[10000], shift[10000], fine[10000];
    int nSig;
    treePair->SetBranchAddress("tsSlc", &tsSlc);
    treePair->SetBranchAddress("tmStp", tmStp);
    treePair->SetBranchAddress("brd", &brd);
    treePair->SetBranchAddress("ch", ch);
    treePair->SetBranchAddress("shift", shift);
    treePair->SetBranchAddress("fine", fine);
    treePair->SetBranchAddress("nSig", &nSig);
    treePair->SetBranchAddress("coarse", coarse);
    for (int iEvet = 0; iEvet < treePair->GetEntries(); iEvet++)
    {
        treePair->GetEntry(iEvet);
        if (nSig == 0)
        {
            std::cout << iEvet << " nSig==0" << " " << tsSlc << " " << tmStp[0] << " " << brd << " " << ch[0] << " " << shift[0] << " " << fine[0] << " " << nSig << " " << coarse[0] << std::endl;
        }

        for (int iSig = 0; iSig < nSig; iSig++)
        {
            std::cout << iEvet << " " << tsSlc << " " << tmStp[iSig] << " " << brd << " " << ch[iSig] << " " << shift[iSig] << " " << fine[iSig] << " " << nSig << " " << coarse[iSig] << std::endl;
        }
    }
}